package org.airlink.persistence.criteria.expressions
{
	import flex.persistence.criteria.Expression;
	
	import org.airlink.persistence.criteria.ExpressionImpl;
	import org.airlink.persistence.criteria.PredicateImpl;
	
	public class Or extends PredicateImpl
	{
		private var x:Expression;
		private var y:Expression;
		
		public function Or(x:ExpressionImpl, y:ExpressionImpl) {
			this.x = x;
			this.y = y;
			for each (var o:Object in x.parameters)				
			_parameters.push(o);
			for each (var o2:Object in y.parameters)				
			_parameters.push(o2);
		}
		
		override public function toString():String{
			var result:String = "";
			result += "(";
			result += "(" + x.asValue() + ")";
			result += "or";
			result += "(" + y.asValue() + ")";
			result += ")";
			return result;
		}
	}
}